/*
 * @Author: your name
 * @Date: 2020-11-02 14:15:40
 * @LastEditTime: 2020-11-03 12:01:16
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \knowledge\js\高阶函数\reduce.js
 */

// let getRootNode = (x,y)=>{
//     let ids = nodes.map(p=>p.id);
//     if(ids.indexOf(y)==-1){
//         nodes.push(y);
//         return nodes;
//     }
// };

// 查询叶子节点
// let n = [{id:1,pId:0,name:'1'},{id:2,pId:1,name:'2'},{id:3,pId :1,name:'3'},{id:4,pId :2,name:'4'}];

// let nodes = [];
// let nIds = n.map(p=>p.pId);
// nodes = n.filter(p=> { return !nIds.includes(p.id)});

// console.log(nodes);
// console.log(111);


// 

var moment = require('moment');
console.log(moment().format());
var nDate = new Date(2020,0,1);
var nDateM = moment(new Date(2020,0,1)).add(1,'years').format('yyyy-MM-DD')
console.log(nDateM);
console.log(11);